﻿using System.ComponentModel;
using RaytracerLib.Layers;
using RaytracerLib.Layers.Interpolators;
using RaytracerLib.Layers.OverlayCorrectors;

namespace Raytracer.PropertyGridDecorators
{
    public class ArrayBaseProperties
    {
        private ArrayBase m_array;

        public ArrayBaseProperties(ArrayBase a_array)
        {
            m_array = a_array;
        }

        [Category(Categories.SIZE)]
        public int Width
        {
            get
            {
                return m_array.Width;
            }
        }

        [Category(Categories.SIZE)]
        public int Height
        {
            get
            {
                return m_array.Height;
            }
        }

        [Category(Categories.PROPERTIES)]
        public OverlayMethod OverlayMethod
        {
            get
            {
                return m_array.OverlayMethod;
            }
            set
            {
                m_array.OverlayMethod = value;
            }
        }

        [Category(Categories.PROPERTIES)]
        public InterpolationMethod InterpolationMethod
        {
            get
            {
                return m_array.InterpolationMethod;
            }
            set
            {
                m_array.InterpolationMethod = value;
            }
        }

        [Category(Categories.TANGENTS)]
        [TypeConverter(typeof(DoubleConverter))]
        public double PixelDelta
        {
            get
            {
                return m_array.TangentsPixelDelta;
            }
            set
            {
                m_array.TangentsPixelDelta = value;
            }
        }

        [Category(Categories.TANGENTS)]
        [TypeConverter(typeof(DoubleConverter))]
        public double Scale
        {
            get
            {
                return m_array.TangentsScale;
            }
            set
            {
                m_array.TangentsScale = value;
            }
        }
    }

    public class ValueArrayFloatFileProperties : ArrayBaseProperties
    {
        private ValueArrayFloatFile m_array;

        public ValueArrayFloatFileProperties(ValueArrayFloatFile a_array) :
            base(a_array)
        {
            m_array = a_array;
        }

        [Category(Categories.PROPERTIES)]
        public string FileName
        {
            get
            {
                return m_array.FileName;
            }
        }
    }

    public class ColorArrayFloatFileProperties : ArrayBaseProperties
    {
        private ColorArrayFloatFile m_array;

        public ColorArrayFloatFileProperties(ColorArrayFloatFile a_array) :
            base(a_array)
        {
            m_array = a_array;
        }

        [Category(Categories.PROPERTIES)]
        public string FileName
        {
            get
            {
                return m_array.FileName;
            }
        }
    }
}